//
//  parser.h
//  parser
//
//  Created by Pei Liu on 10/25/11.
//  Copyright 2011 __FOR CS440 COMPILER__. All rights reserved.
//

#ifndef PARSER_H
#define PARSER_H

#include <stdio.h>
#include <stdlib.h>
#include "string.h"
#include "dynamic_array.h"
#define MAXMEMO 10000
#define MAXCODE 32766
#define STRSIZE 2000
/*From yylex, for error report*/
extern int lineNbr;
/*from parser*/
extern int procounter[];
extern int cur_proc;
extern int cur_cs;
extern d_array* cs;
/*mangling id*/
char* changeid(char* in);
/*emit to code store*/
void emit(int opcode, int operand1, int operand2);
/*backpatching*/
void bpatch(int index, int newval);
/*add header*/
void addheader(FILE* fout, int cs_size, int beginstr, int strused, int enterpoint);
/*strtrav*/
void strlisttrav(FILE* fout, char** strlist, int strNbr);

#endif
